#include "arrayList.h"
#include <iostream>
#include <fstream>
using namespace std;
bool input(int& n, int& m);
int main() {
	int m = 0;
	int n = 0;
	if(!input(n, m))
		return 0;
	arrayList<int> group(n);
	group.Josephus(n, m);
	cout << "********************************************************"<<'\n';
	linkList<int> linkedgroup;
	linkedgroup.insertGroups(n);
	linkedgroup.Josephus(n,m);
	return 0;
}
bool input(int& n, int& m) {
	ifstream read;
	read.open("d://input.txt");
	read >> n >> m;
	read.close();
	if (n < 3 || n>100 || m<1) {
		cout << "WRONG" << '\n';
		return false;
	}
	return true;
}